Skip to content

Conversation

@tirthpatell
Copy link
Owner

December 16, 2025:

  • Add is_verified and profile_picture_url fields to Post struct
  • Update PostExtendedFields and ReplyFields constants
  • Fields available for replies and mentions (direct replies only for conversations)

December 22, 2025:

  • Add ErrCodeLinkLimitExceeded constant (THREADS_API__LINK_LIMIT_EXCEEDED)
  • Add integration tests for link count validation

December 16, 2025:
- Add is_verified and profile_picture_url fields to Post struct
- Update PostExtendedFields and ReplyFields constants
- Fields available for replies and mentions (direct replies only for conversations)

December 22, 2025:
- Add ErrCodeLinkLimitExceeded constant (THREADS_API__LINK_LIMIT_EXCEEDED)
- Add integration tests for link count validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@greptile-apps
Copy link

greptile-apps bot commented Jan 19, 2026

Greptile Summary

This PR implements two December 2025 Threads API updates:

December 16, 2025 Changes:

  • Added is_verified and profile_picture_url fields to the Post struct
  • Updated PostExtendedFields and ReplyFields constants to include the new fields
  • These fields are available for replies and mentions (for conversations, only on direct replies)

December 22, 2025 Changes:

  • Added ErrCodeLinkLimitExceeded constant for the THREADS_API__LINK_LIMIT_EXCEEDED error code
  • Added comprehensive integration tests for link count validation scenarios

The changes properly integrate with the existing link validation logic in validation.go (which already enforces the 5-link limit). The new error code constant provides better error handling when the API rejects posts exceeding the link limit.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are straightforward API updates that align with the Threads API changelog. The new Post fields are properly documented with clear availability constraints, the constants are correctly formatted and well-documented, and the integration tests comprehensively cover the link validation scenarios including edge cases (duplicate link attachments). The changes integrate cleanly with existing validation logic without requiring modifications.
  • No files require special attention

Important Files Changed

Filename Overview
constants.go Added is_verified and profile_picture_url fields to PostExtendedFields and ReplyFields constants, and introduced ErrCodeLinkLimitExceeded constant for API error handling
types.go Added IsVerified and ProfilePictureURL fields to Post struct with appropriate documentation describing availability constraints
tests/integration/integration_test.go Added three comprehensive test cases for link limit validation: testing 6 unique links, 5 links in text + 1 different link attachment, and duplicate link attachment handling

Sequence Diagram

sequenceDiagram
    participant Client
    participant ThreadsAPI
    participant Validator
    participant PostStruct

    Note over Client,PostStruct: December 16, 2025 Update: New Post Fields
    
    Client->>ThreadsAPI: Request Post/Reply/Mention
    ThreadsAPI-->>PostStruct: Return Post with is_verified & profile_picture_url
    Note over PostStruct: Fields available for replies/mentions<br/>(conversations: direct replies only)
    
    Note over Client,PostStruct: December 22, 2025 Update: Link Limit Validation
    
    Client->>Validator: CreateTextPost(content with links)
    Validator->>Validator: ValidateLinkCount(text, linkAttachment)
    alt > 5 unique links
        Validator-->>Client: ValidationError
        Note over Client: Too many links error
    else <= 5 unique links
        Validator->>ThreadsAPI: POST /{threads-user-id}/threads
        alt API validation fails
            ThreadsAPI-->>Client: THREADS_API__LINK_LIMIT_EXCEEDED
        else Success
            ThreadsAPI-->>Client: Post created successfully
        end
    end
Loading

@greptile-apps
Copy link

greptile-apps bot commented Jan 19, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@tirthpatell tirthpatell merged commit 42f71ca into main Jan 19, 2026
8 of 9 checks passed
@tirthpatell tirthpatell deleted the feature/api-updates-dec-2025 branch January 19, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant